<?php
/**
 * FileName: category.php
 * Date:July 2011
 * License: GNU General Public License 
 * JOS Version #: 1.6.x
 * Development OrdaSoft(http://ordasoft.com)
 */
defined('_JEXEC') or die('Restricted access');

class JFormFieldUser extends JFormField
{
  protected $type = 'user';

  protected function getInput() {

  $db = &JFactory::getDBO();


    $query = 'SELECT u.name AS user, u.username AS username, u.name AS title, u.email
              FROM #__users AS u,
                   #__rem_houses AS h
              WHERE h.owneremail=u.email AND published = 1
              GROUP BY u.name
              ORDER BY u.name';
		$db->setQuery( $query );
		$showownerhouses = $db->loadObjectList();

    $p = JHtml::_('select.genericlist', $showownerhouses, $this->name, 'class="inputbox"', 'user', 'user', $this->value, $this->name);

   return $p;
  }
 }
